sap.ui.define(
  ["sap/ui/core/util/MockServer", "sap/base/util/UriParameters"],
  function (MockServer, UriParameters) {
    "use strict";
    return {
      init: function () {
        // create
        let oMockServer = new MockServer({
          rootUri: "https://services.odata.org/V2/Northwind/Northwind.svc/",
        });
        let oUriParameters = new UriParameters(window.location.href);

        // configure delay
        MockServer.config({
          autoRespond: true,
          autoRespondAfter: oUriParameters.get("serverDelay") || 500,
        });

        // simulate
        let sPath = sap.ui.require.toUrl("demo/walkthrough/localService");
        oMockServer.simulate(`${sPath}/metadata.xml`, `${sPath}/mockdata`);

        // start
        oMockServer.start();
      },
    };
  }
);
